{php}
$row['values']=isset($row['values'])?json_decode($row['values'],true):[];
{/php}
<div class="panel panel-default panel-intro">
    <div class="panel-heading">
        <div class="alert alert-danger-light">
            <p><i class="fa fa-info"></i> {:__('企业微信配置')}<a target="_blank" href="https://doc.fastadmin.net/facrm">点击查看文档》</a></p>
        </div>

        {:build_heading(null,FALSE)}
    </div>
    <div class="panel-body">
        <div id="myTabContent" class="tab-content">
            <div class="tab-pane fade active in" id="one">
                <div class="widget-body no-padding">
                    <form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
                        <input id="c-key" type="hidden" data-rule="required"  class="form-control" name="row[key]" value="{$key}" readonly/>
                        <div class="row">
                            <div class=" form-group">
                                <label for="c-describe" class="control-label col-xs-12 col-sm-2">{:__('企业名称')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input id="c-describe" data-rule="required" type="text" class="form-control" name="row[describe]" value="{:isset($row['describe'])?$row['describe']:''}"  />
                                </div>
                            </div>

                            <div class=" form-group">
                                <label for="c-corp_id" class="control-label col-xs-12 col-sm-2">{:__('企业ID')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input id="c-corp_id" data-rule="required" type="text" class="form-control"
                                           name="row[values][corp_id]" value="{:isset($row['values']['corp_id'])?$row['values']['corp_id']:''}"  />
                                </div>
                            </div>
                            <div class=" form-group">
                                <label for="c-contacts_secret" class="control-label col-xs-12 col-sm-2">{:__('通讯录Secret')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input id="c-contacts_secret" data-rule="required" type="text" class="form-control"
                                           name="row[values][contacts_secret]" value="{:isset($row['values']['contacts_secret'])?$row['values']['contacts_secret']:''}"  />
                                </div>
                            </div>

                            <div class=" form-group">
                                <label for="c-customer_secret" class="control-label col-xs-12 col-sm-2">{:__('客户管理Secret')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input id="c-customer_secret" data-rule="required" type="text" class="form-control" name="row[values][customer_secret]"
                                           value="{:isset($row['values']['customer_secret'])?$row['values']['customer_secret']:''}"  />
                                </div>
                            </div>

                            <div class=" form-group">
                                <label for="c-customer_callback" class="control-label col-xs-12 col-sm-2">{:__('客户管理回调URL')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input id="c-customer_callback" data-rule="required" type="text" class="form-control" name="row[values][customer_callback]"
                                           value="{:isset($row['values']['customer_callback'])?$row['values']['customer_callback']:''}"   />
                                </div>
                            </div>

                            <div class=" form-group">
                                <label for="c-customer_callback_token" class="control-label col-xs-12 col-sm-2">{:__('客户管理回调token')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input id="c-customer_callback_token" data-rule="required" type="text" class="form-control" name="row[values][customer_callback_token]"
                                           value="{:isset($row['values']['customer_callback_token'])?$row['values']['customer_callback_token']:''}"   />
                                </div>
                            </div>
                            <div class=" form-group">
                                <label for="c-EncodongAESKey" class="control-label col-xs-12 col-sm-2">{:__('客户EncodongAESKey')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input id="c-EncodongAESKey" data-rule="required" type="text" class="form-control" name="row[values][EncodongAESKey]"
                                           value="{:isset($row['values']['EncodongAESKey'])?$row['values']['EncodongAESKey']:''}"   />
                                </div>
                            </div>


                            <div class=" form-group">
                                <label for="c-agent_id" class="control-label col-xs-12 col-sm-2">{:__('自建应用AgentId')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input id="c-agent_id" data-rule="required" type="text" class="form-control" name="row[values][agent_id]"
                                           value="{:isset($row['values']['agent_id'])?$row['values']['agent_id']:''}"   />
                                </div>
                            </div>



                            <div class=" form-group">
                                <label for="c-agent_secret" class="control-label col-xs-12 col-sm-2">{:__('自建应用Secret')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input id="c-agent_secret" data-rule="required" type="text" class="form-control" name="row[values][agent_secret]"
                                           value="{:isset($row['values']['agent_secret'])?$row['values']['agent_secret']:''}"   />
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">{:__('微信企业客户同步来源')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    {:build_select('row[values][source]', $sourceList,isset($row['values']['source'])?$row['values']['source']:0, ['class'=>'form-control selectpicker', 'data-rule'=>'required'])}
                                    <span class="text-gray">通过微信企业客户添加的客户来源</span>
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="c-group_id" class="control-label col-xs-12 col-sm-2">{:__('企业微信员工归属组')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    {:build_select('row[values][group_id]', $groupdata, isset($row['values']['group_id'])?$row['values']['group_id']:'', ['class'=>'form-control selectpicker', 'data-rule'=>'required', 'id'=>'c-group_id'])}
                                    <span class="help-block">同步企业微信员工会自动生成后台帐号，根据userid为对应username为唯一条件，生成的密码为改员工的手机号</span>
                                </div>
                            </div>

                            <div class="form-group layer-footer">
                                <label class="control-label col-xs-12 col-sm-2"></label>
                                <div class="col-xs-12 col-sm-8">
                                    <button type="submit" class="btn btn-success btn-embossed disabled">{:__('submit')}</button>
                                    <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
                                </div>
                            </div>
                    </form>



                </div>
            </div>

        </div>
    </div>
</div>





